﻿
//===============================================================================
//	COpenMissionDialog
//	打开任务对话框
//===============================================================================

#include "COpenMissionDialog.h"


//-------------------------------------------------------------------------------
COpenMissionDialog::COpenMissionDialog(uint32_t uid, uint32_t pn)
	: BaseMessage(uid, pn)
{
	_safe_guard_begin;
	_safe_guard_end;
}

//-------------------------------------------------------------------------------
COpenMissionDialog::~COpenMissionDialog(void)
{

}

//-------------------------------------------------------------------------------
void COpenMissionDialog::SetMissionDialogue(MissionDialogue*& stData)
{
	_safe_guard_begin;

	if (stData->GetTitle())
	{
		m_jv["title"] = stData->GetTitle()->c_str();
	}
	
	if (stData->GetDescribe())
	{
		m_jv["disc"] = stData->GetDescribe()->c_str();
	}

	if (stData->GetOption1())
	{
		m_jv["opt1"] = stData->GetOption1()->c_str();
	}

	if (stData->GetOption2())
	{
		m_jv["opt2"] = stData->GetOption2()->c_str();
	}

	if (stData->GetOption3())
	{
		m_jv["opt3"] = stData->GetOption3()->c_str();
	}

	if (stData->GetOption4())
	{
		m_jv["opt4"] = stData->GetOption4()->c_str();
	}

	m_jv["msId"] = stData->GetMissionId();
	m_jv["scrId"] = 0; // (不用了)
	m_jv["user1"] = stData->GetUserVal1();
	m_jv["user2"] = stData->GetUserVal2();	
	m_jv["user3"] = stData->GetUserVal3();//1任务接受对话结束2任务提交对话结束

	m_jv["ret"] = 0;

	_safe_guard_end;
}
